package com.ruoyi.personal_owned.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.personal_owned.mapper.PersonalOwnedGiftMapper;
import com.ruoyi.personal_owned.domain.PersonalOwnedGift;
import com.ruoyi.personal_owned.service.IPersonalOwnedGiftService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户拥有礼物Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-08
 */
@Service
public class PersonalOwnedGiftServiceImpl implements IPersonalOwnedGiftService 
{
    @Autowired
    private PersonalOwnedGiftMapper personalOwnedGiftMapper;

    /**
     * 查询用户拥有礼物
     * 
     * @param id 用户拥有礼物主键
     * @return 用户拥有礼物
     */
    @Override
    public PersonalOwnedGift selectPersonalOwnedGiftById(Long id)
    {
        return personalOwnedGiftMapper.selectPersonalOwnedGiftById(id);
    }

    /**
     * 查询用户拥有礼物列表
     * 
     * @param personalOwnedGift 用户拥有礼物
     * @return 用户拥有礼物
     */
    @Override
    public List<PersonalOwnedGift> selectPersonalOwnedGiftList(PersonalOwnedGift personalOwnedGift)
    {
        return personalOwnedGiftMapper.selectPersonalOwnedGiftList(personalOwnedGift);
    }

    /**
     * 新增用户拥有礼物
     * 
     * @param personalOwnedGift 用户拥有礼物
     * @return 结果
     */
    @Override
    public int insertPersonalOwnedGift(PersonalOwnedGift personalOwnedGift)
    {
        return personalOwnedGiftMapper.insertPersonalOwnedGift(personalOwnedGift);
    }

    /**
     * 修改用户拥有礼物
     * 
     * @param personalOwnedGift 用户拥有礼物
     * @return 结果
     */
    @Override
    public int updatePersonalOwnedGift(PersonalOwnedGift personalOwnedGift)
    {
        return personalOwnedGiftMapper.updatePersonalOwnedGift(personalOwnedGift);
    }

    /**
     * 批量删除用户拥有礼物
     * 
     * @param ids 需要删除的用户拥有礼物主键
     * @return 结果
     */
    @Override
    public int deletePersonalOwnedGiftByIds(String ids)
    {
        return personalOwnedGiftMapper.deletePersonalOwnedGiftByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户拥有礼物信息
     * 
     * @param id 用户拥有礼物主键
     * @return 结果
     */
    @Override
    public int deletePersonalOwnedGiftById(Long id)
    {
        return personalOwnedGiftMapper.deletePersonalOwnedGiftById(id);
    }
}
